#if !defined(_FNTCOMBO_H__INCLUDED_)
#define _FNTCOMBO_H__INCLUDED_

#include <afxtempl.h>
#pragma once

#define FCB_INMRU		0x00000001
#define FCB_STARTPOS	0x00000002

#define FCB_DRAWNORMAL	0x00000001
#define FCB_DRAWRAISED	0x00000002
#define FCB_DRAWPRESSD	0x00000004

/////////////////////////////////////////////////////////////////////////////
// CFontComboBox window

class CFontComboBox : public CComboBox
{
	typedef struct tagFCBDATA{
		LOGFONT lf;
		UINT flag;
	}FCBDATA, *PFCBDATA;
public:
	void Initialize(int nMRUCount = 10);

	//{{AFX_VIRTUAL(CFontComboBox)
	public:
	virtual void PreSubclassWindow();
	protected:
	virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	//}}AFX_VIRTUAL

protected:
	// font-drawing members
	int m_nMRUCount;
	CImageList m_imagelist;
	CTypedPtrMap<CMapStringToPtr, CString, PFCBDATA> m_mapFont;
	CTypedPtrMap<CMapStringToPtr, CString, PFCBDATA> m_mapFontMRU;
	// font-drawing functions
	static BOOL CALLBACK AFX_EXPORT EnumScreenFontCallbackFn(ENUMLOGFONTEX* pelf, 
		NEWTEXTMETRICEX* /*lpntm*/, int FontType, LPVOID pThis);
	BOOL EnumFont();
	void SetFontMRU(const CString& strFont);

	// flat-drawing members
	BOOL m_bLBtnDown;
	// flat-drawing functions
	void DrawCombo(DWORD dwStyle, COLORREF clrTopLeft, COLORREF clrBottomRight);
	int Offset()
	{
		return ::GetSystemMetrics(SM_CXHTHUMB);
	};

	//{{AFX_MSG(CFontComboBox)
	afx_msg void OnCloseup();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnNcDestroy();
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#endif // !defined(_FNTCOMBO_H__INCLUDED_)